package com.erp.data;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the erpbaseusergroup database table.
 * 
 */
@Embeddable
public class ErpbaseUserGroupPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private long groupId;
	private long userId;

    public ErpbaseUserGroupPK() {
    }

	@Column(name="GROUP_ID", unique=true, nullable=false, precision=10)
	public long getGroupId() {
		return this.groupId;
	}
	public void setGroupId(long groupId) {
		this.groupId = groupId;
	}

	@Column(name="USER_ID", unique=true, nullable=false, precision=10)
	public long getUserId() {
		return this.userId;
	}
	public void setUserId(long userId) {
		this.userId = userId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ErpbaseUserGroupPK)) {
			return false;
		}
		ErpbaseUserGroupPK castOther = (ErpbaseUserGroupPK)other;
		return 
			(this.groupId == castOther.groupId)
			&& (this.userId == castOther.userId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.groupId ^ (this.groupId >>> 32)));
		hash = hash * prime + ((int) (this.userId ^ (this.userId >>> 32)));
		
		return hash;
    }
}